package com.example.opengldemo.buffer;

public class BallGoThread extends Thread {
	BallForControl ballForControl;
	int timeSpan=12;
	private boolean flag=false;
	
	public BallGoThread(BallForControl ballForControl)
	{
		this.ballForControl=ballForControl;
	}
	
	@Override
	public void run()
	{
		while(flag)
		{	
			ballForControl.go();
			
			try{
				Thread.sleep(timeSpan);
			}
			catch(Exception e){
				e.printStackTrace();
			}
		}		
	}
	public void setFlag(boolean flag) {
		this.flag = flag;
	}
}
